home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
HENSA
/
COMMS
/
NLISTMGR.ARC
/
NM0,80Docs
< prev
next >
Wrap
Text File
|
1994-07-26
|
11KB
|
304 lines
NListMgr 0.80 documentation (draft)
(C) Steven Haslam July 1994
NListMgr provides routines to load the domains file, pass the domains file
information (decoded) onto clients and to lookup and scan FTN nodelists.
NListMgr is loaded in the normal way. It may be given the pathname of a
directory on its load command-line, which it will assume contains the domains
file, named "Domains". It will then proceed to load the file.
(Under RiscOS 3, NListMgr will "canonicalise" the filename given before using
it. This means that system variables and paths will be expanded and
references according to the CSD, CSL or URD will be converted to complete
pathnames; so you can therefore get away with entering "RMLoad %.NListMgr
^.Nodelist". This facility is not available under RiscOS 2)
To load the file at any other time, use the command "NListMgr_Load". Using
this command without parameters will use the name given last.
If NListMgr is loaded without parameters, it will look for the nodelist
directory using the system variable NListMgr$NodeListDir.
SWI NListMgr_GetSystInfo (&CCF00)
\E R0 = pointer to ExtAddr struct
\X R0 = pointer to OldSystInfo struct, or 0 if not found
This SWI uses old-style structures. Its use is deprecated, it calls
NListMgr_Lookup, which you should use in preference.
SWI NListMgr_ListSysts (&CCF01)
\E R0 = pointer to ExtAddr struct (not necessarily complete)
R1 = input reason code
R2 = buffer pointer
R3 = buffer size
\X R0 = number of entries written
R1 = output reason code
This SWI uses old-style structures. Its use is deprecated, it calls
NListMgr_Scan, which you should use in preference.
SWI NListMgr_DomainsFile (&CCF02)
\X R0 = pointer to filename of domains file (0-terminated)
This SWI returns a pointer to the domains file. Its use is deprecated, you
should use NListMgr_DomainsTable to read the decoded information.
SWI NListMgr_SystFlag (&CCF05)
\E R0 = pointer to ExtAddr struct
R1 = pointer to wildcarded flag name
\X R0 = non-zero if flag found
R1 = pointer to actual flag found.
This SWI uses old-style structures. Its use is deprecated, it calls
NListMgr_Flags, which you should use in preference.
SWI NListMgr_Lookup (&CCF06)
\E any of
R0=domain number, R1=zone, R2=net, R3=node, R4=point
R0=ptr to address structure (>=&8000)
R1=reason code
\X R1=0 on entry
R0=pointer to SystInfo struct, or 0 if not found
else if R1=1
R0=non-zero if found, zero otherwise
else error returned
This SWI searches the nodelist for a system according to address.
An "address structure" is five words, being:
Offset Meaning
+0 Domain number
+4 Zone number
+8 Net number
+12 Node number
+16 Point number
The "domain number" is an index, starting from 0, into the domains table (or
line number, starting from 0, of the domains file).
The structure returned by this call is as follows:
Offset Meaning
+0 Pointer to name of system
+4 Pointer to site of system
+8 Pointer to operator of system
+12 Pointer to phone number of system
+16 Pointer to password for system
+20 Mail status: 0 = never accepts mail, 1 = mail during ZMH, 2 = mail
24hrs a day
+24 "Maximum connect rate", in bps (usually 9600 for V32b &c.)
+28 Cost band
+32 Pointer to gateway flags of system (or 0)
+36 Pointer to capability flags of system (or 0)
+40 Pointer to user flags of system (or 0)
All strings referenced above are 0-terminated. They are pointers straight
into NListMgr's data cache, and should therefore be copied if being kept for
a long time; "long time" meaning, in this context, over calls to NListMgr,
possibly by other tasks.
NListMgr first searches the data cache, so multiple lookups to the same
system in a short time, if the system is found, will be fairly quick.
NListMgr then searches the index cache, the extent of which is user-defined;
commonly, only nodes that are password-protected or have been edited.
NListMgr finally searches the index file, using the zone cache information to
speed up searching.
If R1 is 1 on entry, then if the system is found, the data is not loaded
into the data cache: this improves timing if the data is not going to be
required, but if the data is then requested, and the system is in only the
main index file, then a complete lookup will be performed again.
SWI NListMgr_Scan (&CCF07)
\E R0 = pointer to address structure (not necessarily complete)
R1 = input reason code
R2 = pointer to buffer
R3 = buffer size
\X R0 = number of entries written to buffer
R1 = output reason code
This call scans the nodelist, and enumerates the contents into a client
buffer. This call allows a client to read the nodelist in terms of its
structure, i.e. read all the zones in a domain, then all the regions in a
zone and so on.
The input reason codes are:
Code Meaning
0 Produce a list of zones, one integer per zone
1 Produce a list of regions, one integer per region
2 Produce a list of hosts, one integer per host
3 Produce a list of systems, two integers per system
4 Produce a list of pointers, one integer per point
When listing systems, the output is in { node, point } pairs, one integer
each.
The output reason codes are 0 for a success, 1 for an overflowed buffer, or 2
for any other error.
Listing the zones in a domain is fast because it uses the zone cache; all
other types require the main index to be scanned.
At the time of writing (17-Jul-1994 00:47:15) all input reason codes except 0
(listZones) are unimplemented, and return an error.
SWI NListMgr_Flags (&CCF08)
\E R0 = pointer to address structure
R1 = pointer to wildcarded flag name
R2 = buffer to store actual flag name, or 0
R3 = size of buffer
\X R0 = non-zero if flag found
If R2!=0 on entry, the buffer at R2 is updated if a match is found
This call may be used to see if a system has a flag set, or has a flag
matching a certain format. The same format is used for wildcards as is used
by filing systems: # matches any character, * matches 0 or more characters,
case is ignored; "*" will match any string.
Note that it is possible to call NListMgr_Lookup and check the flags
yourself: if the above is not quite want you want to do, coding your own
check is advisable.
SWI NListMgr_DomainsTable (&CCF09)
\E R0 = pointer to table buffer, or 0 to get size
R1 = size of buffer pointed to by R0 if R0!=0
R2 = pointer to data buffer if R0!=0
R3 = size of data buffer if R0!=0
R4 = flags:
bit 0 set => terminate strings with CR, not NUL
bit 1 set => return one domain only, see R5
all other bits should be clear
R5 = number of domain to return (if bit 1 of R4 set)
\X R0 preserved
R1 = size required for table buffer if R0=0 on entry, else preserved
R2 preserved
R3 = size required for data buffer if R0=0 on entry, else preserved
R4 = number of domains
When called with R0!=0, this command fills two buffers. The "table buffer" is
a table of data structures giving information on each domain; this contains
string pointers into the data buffer, which has no other significance.
Each entry in the domain table is 5 words long:
Offset Meaning
+0 Pointer to domain name
+4 Pointer to domain I/O string
+8 Pointer to domain nodelist directory string
+12 Integer containing technology type
+16 Pointer to other information that was in the domains file
Indices into this table, with the first element numbered as 0, are identical
to "domain numbers" in address structures.
Setting bit 0 of R4 on entry causes the strings in the data buffer to be
terminated with CR characters (ASCII code 13) not NUL (ASCII code 0): this is
to assist BASIC programmers.
Setting bit 1 of R4 on entry reads the information for one domain only,
the number of which is specified in R5; this means that programs need not
store the entire table all the time.
*NListMgr_Load [<fsp>]
This command will cause NListMgr to reload the domains file, reload nodelist
indices and flush the data cache. If no nodelist directory is given, the
previos one is used.
*NListMgr_Domains
This command will list the current domains table
*NListMgr_CacheStatus
This command will give the sizes of the caches, and also list the systems in
the data cache, with their cache ages.
<NListMgr$NodeListDir>
This system variable is used as a default for the nodelist directory, if none
has been given on the command line: it is normally set by the !NListMgr
application.
<NListMgr$DataCacheSize>
This system variable may be set by the user to change the cache size from the
default (4 systems). This must be greater than or equal to 1: disabling the
data cache entirely is not permitted.
This system variable is read every time the cache is re-initialised: i.e. on
module loading, and on execution of the NListMgr_Load command.
<NListMgr$FileCacheSize>
This system variable may be set by the user to change the size of the file
cache used when (if) the entire index file is being read: the index file is
read in chunks of this size.
Setting NListMgr$FileCacheSize to 0 disables file cacheing, recommended only
if you index-cache all systems.
Further notes:
The SWIs which use old-style structures are compatible with same-numbered
SWIs in previous version of the module. They are "wrappings" for the new
SWIs, which use the address structures and information structures stored in
the data cache. You are advised to use the new SWIs where possible; but the
old SWIs have been provided for the express purpose of backward-compatiblity.
Lists produced by NListMgr_Scan are not "tidied": they may contain duplicate
numbers, and are not sorted. Duplicates may arise where systems or nodelists
have been joined at compilation: if 1:374/777, then 2:250/116, then 3:713/601
are added onto a region 25 nodelist (zone 2), 4 zones will be listed: zones
2, 1, 2 and 3.
It is [will be] possible for NListMgr_Scan to return no entries even where
systems are present: for example, the addition of a single node in zone 1
will produce no regions or hosts in zone 1. A method of listing all the
systems in zone 1 in this case has yet to be defined.
In the above case, the zone will always be listed, even if no ZC system was
compiled.
SWIs &CCF03 and &CCF04 are undefined, and return an error.
Proper loading of the module:
The NListMgr module should be loaded, if necessary using the RMEnsure command
to check if it is already in memory. Programs should execute the command
"/NListMgr:Ensure" to load NListMgr if it is not already loaded. Obviously,
this requires the setting of NListMgr$Path, which should contain a file
called "Ensure" that loads the module; this is normally set to the !NListMgr
applcation, although this is not necessary.
A recommended set of commands to load NListmgr 0.80 is:
If "<NListMgr$Path_Message>"="" THEN Set NListMgr$Path_Message Please open a
directory display containing the !NListMgr application, or load the NListMgr
module.
RMEnsure NListMgr 0.80 /NListMgr:Ensure
RMEnsure NListMgr 0.80 NListMgr 0.80 or later is required to run XXXXXXX
Under RISC-OS 3, this will print a more informative message if !NListMgr has
not been "seen" by the Filer.
-----------------------------------------------------------------------------
Steven Haslam, 112 Keighley Road, Colne, Lancashire, BB8 0PH, ENGLAND
VOICEphone: (+44)-(0)282-866835
-----------------------------------------------------------------------------
Revised 26-Jul-1994 NListMgr_DomainsTable returning only one domain
NListMgr$FileCacheSize